package com.sqx.modules.creation.controller;


import com.sqx.common.utils.Result;
import com.sqx.modules.creation.entity.NLabel;
import com.sqx.modules.creation.entity.dto.AuditCreationDto;
import com.sqx.modules.creation.entity.dto.GetCreationListDto;
import com.sqx.modules.creation.service.CreationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 创作表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024年09月03日
 */
@RestController
@RequestMapping("/system/creation")
public class CreationController {

    @Autowired
    private CreationService creationService;

    /**
     * 作品列表
     * @param getCreationListDto
     * @return
     */
    @GetMapping("/getCreationList")
    public Result getCreationList(GetCreationListDto getCreationListDto){
        return creationService.getCreationList(getCreationListDto);
    }

    /**
     * 审核作品
     * @param auditCreationDto
     * @return
     */
    @PostMapping("/auditCreation")
    public Result auditCreation(@Valid@RequestBody AuditCreationDto auditCreationDto){
        return creationService.auditCreation(auditCreationDto);
    }

    /**
     * 获取作品详情
     * @return
     */
    @GetMapping("/getCreationDetail")
    public Result getCreationDetail(Integer creationId){
        return creationService.getCreationDetail(creationId);
    }

    /**
     * 删除作品
     * @param
     * @return
     */
    @PostMapping("/deleteCreation/{creationIds}")
    public Result deleteCreationById(@PathVariable Long[] creationIds){
        return creationService.deleteCreationById(creationIds);
    }



}

